home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 3.1 KB | 120 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: TextFacet.h
- // Release Version: $ 1.0d1 $
- //
- // Author: Anthone Burbidge
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef _TEXTFACET_
- #define _TEXTFACET_
-
- // ----- Textension Includes -----
-
- #ifndef _TextensionCommon_
- #include "TextensionCommon.h"
- #endif
-
- // ----- Framework Includes -----
-
- #ifndef FWFACET_H
- #include "FWFacet.h"
- #endif
-
- #ifndef FWDROPTR_H
- #include "FWDropTr.h"
- #endif
-
- //========================================================================================
- // Forward class declarations
- //========================================================================================
-
- class CTextPart;
-
-
- //========================================================================================
- // CLASS CTextFacet
- //========================================================================================
-
- class CTextFacet : public FW_CFacet
- {
- // ----- Construction/destruction
- public:
- CTextFacet();
- void InitTextFacet(XMPFacet* facet,
- CTextPart* textPart);
- virtual ~CTextFacet();
-
- // ----- Inherited API
- public:
- virtual void Draw(FW_CGraphicContext *gc);
- virtual FW_Boolean DoMouseDown(const FW_CPoint& where,
- XMPEventData event);
- virtual void MouseEnter(const FW_CPoint& where);
-
- // ----- Drag and drop
- public:
- virtual FW_CDropTracker*NewDropTracker(FW_CFacet* facet);
- virtual void DragEnter(XMPDragItemIterator* dragInfo, const FW_CPoint& where);
- virtual FW_Boolean DrawDragHiliteInside();
-
- // ----- Accessors
- CTextPart* GetTextPart() const;
-
- // ----- Fields
- private:
- CTextPart* fTextPart;
- };
-
- //----------------------------------------------------------------------------------------
- // CTextFacet::GetTextPart
- //----------------------------------------------------------------------------------------
-
- CTextPart* CTextFacet::GetTextPart() const
- {
- return fTextPart;
- }
-
-
- //========================================================================================
- // CLASS CTextDropTracker
- //========================================================================================
-
- class CTextDropTracker : public FW_CDropTracker
- {
- // ----- Initialization/destruction
- public:
- CTextDropTracker();
- virtual ~CTextDropTracker();
- void InitTextDropTracker(CTextFacet* facet);
-
- // ----- Tracking
- virtual void BeginTracking(const FW_CPoint& where);
- virtual void ContinueTracking(const FW_CPoint& where);
- virtual void EndTracking(const FW_CPoint& where);
-
- // ----- New Methods
- TOffset GetCharOffset(const FW_CPoint& pt) const;
- void DrawCaret(TOffset charOffset);
- CTextPart* GetTextPart() const;
-
- // ----- Fields
- private:
- TOffset fCharOffset;
- };
-
- //----------------------------------------------------------------------------------------
- // CTextDropTracker::GetTextPart
- //----------------------------------------------------------------------------------------#endif
-
- CTextPart* CTextDropTracker::GetTextPart() const
- {
- return ((CTextFacet *) fFacet)->GetTextPart();
- }
-
- #endif
-